﻿


using YuanRegression.Models;

namespace YuanRegression
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //从数据文件读取数据
            var model = new RegressionModel();
            model.X = MyFunctions.ListReadTxt(@$"{System.Environment.CurrentDirectory}\DataFiles\Year.txt");
            model.Y = MyFunctions.ListReadTxt(@$"{System.Environment.CurrentDirectory}\DataFiles\Gdp.txt");
            //计算参数
            model.Compute();
            //预测
            var gdp =  model.Forecast(2022);
            Console.WriteLine($"预测2021年的GDP为{gdp.ToString("##.##")}万亿美元");
        }
    }
}